Skip to content

feat: add textToNumber utility and tests (fixes #62) - #148

Closed
SHAKSHIY wants to merge 1 commit into
Samarth2190:mainfrom
SHAKSHIY:feature/text-to-number-62
Closed

feat: add textToNumber utility and tests (fixes #62)#148
SHAKSHIY wants to merge 1 commit into
Samarth2190:mainfrom
SHAKSHIY:feature/text-to-number-62

Conversation

@SHAKSHIY

Copy link
Copy Markdown

Summary

Adds textToNumber — a utility that converts English number words to numeric values.

Examples:

  • "five" -> 5
  • "twenty one" -> 21
  • "five hundred twelve" -> 512
  • "one thousand and twenty five" -> 1025
  • "three million one hundred" -> 3000100

Changes

  • src/textToNumber.ts - new implementation
  • src/tests/textToNumber.test.ts - new tests
  • src/index.ts - exported textToNumber

Tests

All tests pass locally:
All textToNumber tests passed!

Closes #62

@SHAKSHIY

Copy link
Copy Markdown
Author

Hi @Samarth2190
The feature and tests for textToNumber are passing locally (All tests passed!).
The CI failure seems to come from existing import paths in src/analyzing/*.ts that require .js extensions when using "moduleResolution": "NodeNext".
These aren’t related to this PR’s code changes.

Please confirm if you’d like me to fix those imports in a separate PR or include them here.

@Samarth2190

Copy link
Copy Markdown
Owner

There are several inconsistencies in the PR.
Like 2 test files, Modification of tsconfig etc. I recommend you to go through some previously merged PRs and make the necessary changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Text2Num

2 participants